import request from "../utils/request";


/**
 * 获取规则列表
 * @param params
 * @returns {AxiosPromise}
 */
export function settleMentRuleApi (params) {
  return request({
    url: "/stlmt/rule",
    method: "get",
    params: params
  });
}

//获取佣金结算列表
export function getCommissionList(params) {
  return request({
    url: "/stlmt/bill",
    method: "get",
    params: params
  });
}
//新增结算记录
export function addCommission(params) {
  return request({
    url: "/stlmt/record",
    method: "post",
    data: params
  });
}

//获取账单详情
export function getBillDetail(id) {
  return request({
    url: `/stlmt/bill/${id}`,
    method: "get"
  });
}

//获取佣金记录结算列表
export function getCommissionRecordList(params) {
  return request({
    url: "/stlmt/record",
    method: "get",
    params: params
  });
}

//获取佣金记录详情
export function getCommissionRecordDetail(id) {
  return request({
    url: `/stlmt/record/${id}`,
    method: "get"
  });
}

// 获取结算账单统计
export function getBillStatistics() {
  return request({
    url: "/stlmt/bill/statistics",
    method: "get"
  });
}

//获取客户详情
export function getCustomerDetail(id) {
  return request({
    url: `/keyike/customer/${id}`,
    method: "get"
  });
}

/**
 * 获取规则详情
 * @param params
 * @returns {AxiosPromise}
 */
export function settleMentDetailApi(id) {
  return request({
    url: `/stlmt/rule/${id}`,
    method: 'get',
  })
}

/**
 * 删除结算规则
 * @param id
 * @returns {AxiosPromise}
 */
export function settleMentDeleteApi(id) {
  return request({
    url: `/stlmt/rule/${id}`,
    method: 'delete',
  })
}

/**
 * 修改结算规则
 * @param id
 * @returns {AxiosPromise}
 */
export function settleMentUpdateApi(params) {
  return request({
    url: `/stlmt/rule`,
    method: 'put',
    data: params
  })
}

/**
 * 新增结算规则
 * @param params
 * @returns {AxiosPromise}
 */
export function settleMentAddApi(params) {
  return request({
    url: `/stlmt/rule`,
    method: 'post',
    data: params
  })
}
